package cn.qiyu5522;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import org.slf4j.MDC;

/**
 * ClassName: RequestIdConverter
 * Package: cn.qiyu5522.interceptors
 * Description:
 *
 * @Author: Tonkey
 * @Create：2024/4/9-17:41
 * @Version: v1.0
 */
public class RequestIdConverter extends ClassicConverter {
    @Override
    public String convert(ILoggingEvent iLoggingEvent) {
        return MDC.get("requestId") != null ? MDC.get("requestId") : "NO_REQUEST_ID";
    }
}
